package com.lhj.library.common.enums;

import lombok.Getter;

/**
 * 图书借出归还状态枚举
 */
@Getter
public enum IsBorrowFlagEnum {

    BORROW(1, "已借出"),
    UN_BORROW(0, "未借出");


    public int code;

    public String desc;

    IsBorrowFlagEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static IsBorrowFlagEnum getByCode(int codeVal) {
        for (IsBorrowFlagEnum resultCodeEnum : IsBorrowFlagEnum.values()) {
            if (resultCodeEnum.code == codeVal) {
                return resultCodeEnum;
            }
        }
        return null;
    }


}
